/**
 * 
 */
package cn.iune.erp.inventory;

import java.math.BigDecimal;
import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

/**
 * @author Administrator
 * 出入库账簿
 *
 */
@Entity
@Table(name="StorageLedgerDetail",uniqueConstraints={@UniqueConstraint(name="storageLedgerDetail1", columnNames={"recordNo", "serialNo", "revOpay", "enterpriseNo"})})
@NamedQuery(name="StorageLedgerDetail.findAll", query="SELECT s FROM StorageLedgerDetail s")
public class StorageLedgerDetail  {


	@Id
	@Column(length=36)
	private String fID;
	
	@Column(length=32)
	private String systemCode;
	@Column(length=4)
	private String billType;
	@Column(length=20)
	private String billTypeName;
	/*
	 * 1:入库
	 * 2:销货
	 * 3:领用
	 * 4:调拨
	 * 5:调整
	 */
	private int dealType = 0;

	private int postedFlag = 0; //过账标识
	
	private Date orderDate;

	@Column(length=1)
	private String revOpay;
	@Column(length=1)
	private String costingCode;
	
	@Column(length=15)
	private String recordNo;

	@Column(length=5)
	private String serialNo;
	@Column(length=32)
	private String fMasterID;
	
	@Column(length=3)
	private String tradeobjType;
	@Column(length=20)
	private String tradeobjTypeLabel;
	@Column(length=32)
	private String tradeobjID;
	@Column(length=32)
	private String tradeobjNo;
	@Column(length=20)
	private String shortName;
	@Column(length=128)
	private String tradeobjName;
	
	@Column(length=3)
	private String storageType;
	@Column(length=20)
	private String storageTypeLabel;
	@Column(length=65)
	private String storageID;
	@Column(length=32)
	private String storageNo;
	@Column(length=20)
	private String storageName;
	@Column(length=128)
	private String floorNo;
	//仓库ID
	//@Column(length=32)
	//private String storehouseID;
	
	@Column(length=32,nullable=true)
	private String itemID;
	@Column(length=30)
	private String itemNo;
	@Column(length=100)
	private String itemName;
	@Column(length=512)
	private String itemProperty;// = "*****";
	@Transient
	private String itemDescribe;
	@Column(length=15)
	private String unitCode;
	@Column(length=20)
	private String unitName;
	
	private int validDays = 0;//有效天数
	private int checkoutAgainDays = 0;//复检天数
	
	@Column(precision=10,scale=2)
	private BigDecimal itemQuantity = BigDecimal.ZERO;

	//件数
	@Column(precision=10,scale=2)
	private BigDecimal pieceQuantity = BigDecimal.ZERO;

	@Transient
	@Column(precision=10,scale=2)
	private BigDecimal accountQuantityI = BigDecimal.ZERO;
	@Transient
	@Column(precision=10,scale=2)
	private BigDecimal accountQuantityO = BigDecimal.ZERO;
	@Transient
	@Column(precision=10,scale=2)
	private BigDecimal pieceQuantityI = BigDecimal.ZERO;
	@Transient
	@Column(precision=10,scale=2)
	private BigDecimal pieceQuantityO = BigDecimal.ZERO;

	//出入库后结存的数量、单位成本和金额。
	@Column(precision=10,scale=2,columnDefinition="DECIMAL(10,2) default 0",nullable=false)
	private BigDecimal itemQuantityL = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal costingAmountL = BigDecimal.ZERO;
	@Column(precision=10,scale=2)
	private BigDecimal pieceQuantityL = BigDecimal.ZERO;
	@Column(precision=38,scale=6)
	private BigDecimal costingAmountPerL = BigDecimal.ZERO;
	
	@Column(precision=38,scale=6)
	private BigDecimal materialAmountPer = BigDecimal.ZERO;
	@Column(precision=38,scale=6)
	private BigDecimal workingAmountPer = BigDecimal.ZERO;
	@Column(precision=38,scale=6)
	private BigDecimal manufactAmountPer = BigDecimal.ZERO;
	@Column(precision=38,scale=6)
	private BigDecimal processAmountPer = BigDecimal.ZERO;
	@Column(precision=38,scale=6)
	private BigDecimal costingAmountPer = BigDecimal.ZERO;

	@Column(precision=38,scale=2)
	private BigDecimal materialAmount = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal workingAmount = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal manufactAmount = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal processAmount = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal costingAmount = BigDecimal.ZERO;

	@Column(length=20)
	private String batchNo;
	@Column(length=50)
	private String batchDescribe;
	private Date produceDate;
	private Date validDate;
	private Date checkoutAgainDate;
	
	@Column(length=20)
	private String storeNo;
	
	@Column(length=20)
	private String projectNo;
	@Column(length=20)
	private String workNo;//工单号
	
	//预占库存
	int frozenFlag = 0;
	
//	@Column(columnDefinition="INT default 0 COMMENT '生成分录'",nullable=false)
//	private int entryFlag = 0;//生成分录
//	@Column(columnDefinition="INT default 0 COMMENT '生成成本分录'",nullable=false)
//	private int entryCost = 0;//生成分录

	@Column(length=255)
	private String comments;
	
	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}


	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}
	public String getSystemCode() {
		return systemCode;
	}
	public void setSystemCode(String systemCode) {
		this.systemCode = systemCode;
	}
	public String getBillType() {
		return billType;
	}
	public void setBillType(String billType) {
		this.billType = billType;
	}
	public String getBillTypeName() {
		return billTypeName;
	}
	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}
	public int getDealType() {
		return dealType;
	}
	public void setDealType(int dealType) {
		this.dealType = dealType;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	public String getRevOpay() {
		return revOpay;
	}
	public void setRevOpay(String revOpay) {
		this.revOpay = revOpay;
	}
	public String getCostingCode() {
		return costingCode;
	}
	public void setCostingCode(String costingCode) {
		this.costingCode = costingCode;
	}
	public String getRecordNo() {
		return recordNo;
	}
	public void setRecordNo(String recordNo) {
		this.recordNo = recordNo;
	}
	public String getSerialNo() {
		return serialNo;
	}
	public void setSerialNo(String serialNo) {
		this.serialNo = serialNo;
	}
	public String getfMasterID() {
		return fMasterID;
	}
	public void setfMasterID(String fMasterID) {
		this.fMasterID = fMasterID;
	}
	public String getStorageType() {
		return storageType;
	}
	public void setStorageType(String storageType) {
		this.storageType = storageType;
	}
	public String getStorageTypeLabel() {
		return storageTypeLabel;
	}
	public void setStorageTypeLabel(String storageTypeLabel) {
		this.storageTypeLabel = storageTypeLabel;
	}
	public String getStorageID() {
		return storageID;
	}
	public void setStorageID(String storageID) {
		this.storageID = storageID;
	}
	public String getStorageNo() {
		return storageNo;
	}
	public void setStorageNo(String storageNo) {
		this.storageNo = storageNo;
	}
	public String getStorageName() {
		return storageName;
	}
	public void setStorageName(String storageName) {
		this.storageName = storageName;
	}
	public String getFloorNo() {
		return floorNo;
	}
	public void setFloorNo(String floorNo) {
		this.floorNo = floorNo;
	}
	public String getItemID() {
		return itemID;
	}
	public void setItemID(String itemID) {
		this.itemID = itemID;
	}
	public String getItemNo() {
		return itemNo;
	}
	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}
	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	public String getItemProperty() {
		return itemProperty;
	}
	public void setItemProperty(String itemProperty) {
		this.itemProperty = itemProperty;
	}
	public String getItemDescribe() {
		return itemDescribe;
	}
	public void setItemDescribe(String itemDescribe) {
		this.itemDescribe = itemDescribe;
	}
	public String getUnitCode() {
		return unitCode;
	}
	public void setUnitCode(String unitCode) {
		this.unitCode = unitCode;
	}
	public String getUnitName() {
		return unitName;
	}
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}
	public int getValidDays() {
		return validDays;
	}
	public void setValidDays(int validDays) {
		this.validDays = validDays;
	}
	public int getCheckoutAgainDays() {
		return checkoutAgainDays;
	}
	public void setCheckoutAgainDays(int checkoutAgainDays) {
		this.checkoutAgainDays = checkoutAgainDays;
	}
	public BigDecimal getItemQuantity() {
		return itemQuantity;
	}
	public void setItemQuantity(BigDecimal itemQuantity) {
		this.itemQuantity = itemQuantity;
	}
	public BigDecimal getPieceQuantity() {
		return pieceQuantity;
	}
	public void setPieceQuantity(BigDecimal pieceQuantity) {
		this.pieceQuantity = pieceQuantity;
	}
	public BigDecimal getAccountQuantityI() {
		return accountQuantityI;
	}
	public void setAccountQuantityI(BigDecimal accountQuantityI) {
		this.accountQuantityI = accountQuantityI;
	}
	public BigDecimal getAccountQuantityO() {
		return accountQuantityO;
	}
	public void setAccountQuantityO(BigDecimal accountQuantityO) {
		this.accountQuantityO = accountQuantityO;
	}
	public BigDecimal getPieceQuantityI() {
		return pieceQuantityI;
	}
	public void setPieceQuantityI(BigDecimal pieceQuantityI) {
		this.pieceQuantityI = pieceQuantityI;
	}
	public BigDecimal getPieceQuantityO() {
		return pieceQuantityO;
	}
	public void setPieceQuantityO(BigDecimal pieceQuantityO) {
		this.pieceQuantityO = pieceQuantityO;
	}
	public BigDecimal getItemQuantityL() {
		return itemQuantityL;
	}
	public void setItemQuantityL(BigDecimal itemQuantityL) {
		this.itemQuantityL = itemQuantityL;
	}
	public BigDecimal getCostingAmountL() {
		return costingAmountL;
	}
	public void setCostingAmountL(BigDecimal costingAmountL) {
		this.costingAmountL = costingAmountL;
	}
	public BigDecimal getPieceQuantityL() {
		return pieceQuantityL;
	}
	public void setPieceQuantityL(BigDecimal pieceQuantityL) {
		this.pieceQuantityL = pieceQuantityL;
	}
	public BigDecimal getCostingAmountPerL() {
		return costingAmountPerL;
	}
	public void setCostingAmountPerL(BigDecimal costingAmountPerL) {
		this.costingAmountPerL = costingAmountPerL;
	}
	public BigDecimal getMaterialAmount() {
		return materialAmount;
	}
	public void setMaterialAmount(BigDecimal materialAmount) {
		this.materialAmount = materialAmount;
	}
	public BigDecimal getWorkingAmount() {
		return workingAmount;
	}
	public void setWorkingAmount(BigDecimal workingAmount) {
		this.workingAmount = workingAmount;
	}
	public BigDecimal getManufactAmount() {
		return manufactAmount;
	}
	public void setManufactAmount(BigDecimal manufactAmount) {
		this.manufactAmount = manufactAmount;
	}
	public BigDecimal getProcessAmount() {
		return processAmount;
	}
	public void setProcessAmount(BigDecimal processAmount) {
		this.processAmount = processAmount;
	}
	public BigDecimal getMaterialAmountPer() {
		return materialAmountPer;
	}
	public void setMaterialAmountPer(BigDecimal materialAmountPer) {
		this.materialAmountPer = materialAmountPer;
	}
	public BigDecimal getWorkingAmountPer() {
		return workingAmountPer;
	}
	public void setWorkingAmountPer(BigDecimal workingAmountPer) {
		this.workingAmountPer = workingAmountPer;
	}
	public BigDecimal getManufactAmountPer() {
		return manufactAmountPer;
	}
	public void setManufactAmountPer(BigDecimal manufactAmountPer) {
		this.manufactAmountPer = manufactAmountPer;
	}
	public BigDecimal getProcessAmountPer() {
		return processAmountPer;
	}
	public void setProcessAmountPer(BigDecimal processAmountPer) {
		this.processAmountPer = processAmountPer;
	}
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	public String getBatchDescribe() {
		return batchDescribe;
	}
	public void setBatchDescribe(String batchDescribe) {
		this.batchDescribe = batchDescribe;
	}
	public Date getProduceDate() {
		return produceDate;
	}
	public void setProduceDate(Date produceDate) {
		this.produceDate = produceDate;
	}
	public Date getValidDate() {
		return validDate;
	}
	public void setValidDate(Date validDate) {
		this.validDate = validDate;
	}
	public Date getCheckoutAgainDate() {
		return checkoutAgainDate;
	}
	public void setCheckoutAgainDate(Date checkoutAgainDate) {
		this.checkoutAgainDate = checkoutAgainDate;
	}
	public String getStoreNo() {
		return storeNo;
	}
	public void setStoreNo(String storeNo) {
		this.storeNo = storeNo;
	}
	public String getProjectNo() {
		return projectNo;
	}
	public void setProjectNo(String projectNo) {
		this.projectNo = projectNo;
	}
	public int getFrozenFlag() {
		return frozenFlag;
	}
	public void setFrozenFlag(int frozenFlag) {
		this.frozenFlag = frozenFlag;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public String getEnterpriseName() {
		return enterpriseName;
	}
	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}
	public String getWorkNo() {
		return workNo;
	}
	public void setWorkNo(String workNo) {
		this.workNo = workNo;
	}
	public BigDecimal getCostingAmount() {
		return costingAmount;
	}
	public void setCostingAmount(BigDecimal costingAmount) {
		this.costingAmount = costingAmount;
	}
	public BigDecimal getCostingAmountPer() {
		return costingAmountPer;
	}
	public void setCostingAmountPer(BigDecimal costingAmountPer) {
		this.costingAmountPer = costingAmountPer;
	}
	public int getPostedFlag() {
		return postedFlag;
	}
	public void setPostedFlag(int postedFlag) {
		this.postedFlag = postedFlag;
	}
	public String getTradeobjType() {
		return tradeobjType;
	}
	public void setTradeobjType(String tradeobjType) {
		this.tradeobjType = tradeobjType;
	}
	public String getTradeobjTypeLabel() {
		return tradeobjTypeLabel;
	}
	public void setTradeobjTypeLabel(String tradeobjTypeLabel) {
		this.tradeobjTypeLabel = tradeobjTypeLabel;
	}
	public String getTradeobjID() {
		return tradeobjID;
	}
	public void setTradeobjID(String tradeobjID) {
		this.tradeobjID = tradeobjID;
	}
	public String getTradeobjNo() {
		return tradeobjNo;
	}
	public void setTradeobjNo(String tradeobjNo) {
		this.tradeobjNo = tradeobjNo;
	}
	public String getShortName() {
		return shortName;
	}
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	public String getTradeobjName() {
		return tradeobjName;
	}
	public void setTradeobjName(String tradeobjName) {
		this.tradeobjName = tradeobjName;
	}




}
